package com.rc.evcharger.mq;


import com.rc.evcharger.action.StdBizAction;
import com.rabbitmq.client.Channel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 启停充电（平台）指令监听器
 * Created by sven on 2019/3/4
 */
@Component("command0EListener")
public class Command0EListener implements ChannelAwareMessageListener {
    private static Logger logger = LogManager.getLogger(Command0EListener.class);

    @Autowired
    private StdBizAction stdBizAction;

    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
        String msg = new String(message.getBody(), "UTF-8");
        logger.info("command0EListener 收到了:{}", msg);
    }
}
